import React from 'react';
import {connect} from 'react-redux';

@connect(state => ({
  todos: state.todos
}))
export default class Counter extends React.Component {

  render() {

    console.log(`render <${this.constructor.name}/> once`);

    const todos = this.props.todos;

    return (
        <div className="counter">
          <div>共计 {todos.list.length} 条，现在展示的是 {todos.filter}</div>
        </div>
    );
  }

}
